﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace YasharEl.Infrastructure.ServiceModel.Messaging
{
    public sealed class MessageHeaderConsumerInformation
    {
        private readonly string _messageHeaderKey;
        private readonly string _messageHeaderNamespace;
        private readonly IMessageHeaderValueConsumer _messageHeaderValueConsumer;

        public MessageHeaderConsumerInformation(string messageHeaderKey, string messageHeaderNamespace, IMessageHeaderValueConsumer messageHeaderValueConsumer)
        {
            Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(messageHeaderKey), "messageHeaderKey could not be null or empty.");
            Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(messageHeaderNamespace), "messageHeaderNamespace could not be null or empty.");
            Contract.Requires<ArgumentNullException>(messageHeaderValueConsumer != null, "messageHeaderValueConsumer could not be null.");

            _messageHeaderKey = messageHeaderKey;
            _messageHeaderNamespace = messageHeaderNamespace;
            _messageHeaderValueConsumer = messageHeaderValueConsumer;
        }

        public string MessageHeaderKey
        {
            get { return _messageHeaderKey; }
        }

        public string MessageHeaderNamespace
        {
            get { return _messageHeaderNamespace; }
        }

        public IMessageHeaderValueConsumer ValueConsumer
        {
            get { return _messageHeaderValueConsumer; }
        }
    }
}
